//
//  STDParam.m
//  STDRenderSDK
//
//  Created by 陈学明 on 2023/3/15.
//

#import "STDSGLParam.h"

@implementation STDSGLParam

- (instancetype)init {
    self = [super init];
    if (self) {
        _blendType = STDSBlendTypeNormal;
        _alpha = 1.0;
        _isVisible = YES;
        _startLife = 0;
        _durationLife = 0;
        _assetID = 0;
        _effects = [NSMutableArray array];
    }
    return self;
}

- (void)addEffect:(STDSEffectType)effect {
    [_effects addObject:@(effect)];
}

- (void)removeEffect:(STDSEffectType)effect {
    [_effects removeObject:@(effect)];
}

- (void)popEffect {
    [_effects removeLastObject];
}

@end

@implementation STDSGLImageParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeImage;
        _data = NULL;
        _textureId = -1;
        _width = 0;
        _height = 0;
    }
    return self;
}

- (void)dealloc {
//    NSLog(@"dealloc--STDSGLImageParam");
}
@end

@implementation STDSGLTextParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeText;
    }
    return self;
}
@end


@implementation STDSGLVideoParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeVideo;
    }
    return self;
}
@end

@implementation STDSGLShapenParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeVideo;
    }
    return self;
}
@end


@implementation STDSGLCompseParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeCompose;
    }
    return self;
}
@end

@implementation STDSGLEmptyParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeEmpty;
    }
    return self;
}
@end

@implementation STDSGLSolidParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeSolidColor;
    }
    return self;
}
@end

@implementation STDSGLCamoraParam

- (instancetype)init {
    self = [super init];
    if (self) {
        self.layerType = STDSLayerTypeCamora;
    }
    return self;
}

@end
